package com.xxxx.mytest.jihe.arraytest

import scala.collection.mutable.ArrayBuffer
//mutable可变
//immutable不可变

/**
 * @program: day0303
 * @description: 尽信书，则不如无书
 * @author: CoreDao
 * @create: 2021-03-03 10:46
 **/
object ArreyBufferTest {
  def main(args: Array[String]): Unit = {

    //不是new出来的，工厂
    val buffer = ArrayBuffer[String]("1", "2", "3")
    buffer.append("c","d")
    buffer.+=("z")
    //加了个:是追加到头
    buffer.+=:("0")
    buffer.foreach(print)
  }
}
